EPD Extension Kit for MSP430 LaunchPad
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
EPD_hardware_driver.h File Reference

The SPI, PWM, Temperature definitions of COG hardware driver. More...

#include "Pervasive_Displays_small_EPD.h"

Go to the source code of this file.

Macros

#define SMCLK_FREQ   (16000000)
 
#define __External_Temperature_Sensor
 
#define SPISEL   P1SEL
 
#define SPISEL2   P1SEL2
 
#define SPIIE   IE2
 
#define SPICTL0   UCB0CTL0
 
#define SPICTL1   UCB0CTL1
 
#define SPIBR0   UCB0BR0
 
#define SPIBR1   UCB0BR1
 
#define SPIMCTL   UCA0MCTL
 
#define SPIIFG   IFG2
 
#define SPIRXBUF   UCB0RXBUF
 
#define SPIRXIFG   UCB0RXIFG
 
#define SPITXBUF   UCB0TXBUF
 
#define SPITXIFG   UCB0TXIFG
 
#define SPISTAT   UCB0STAT
 
#define SPI_baudrate   (SMCLK_FREQ/COG_SPI_baudrate)
 

Functions

void spi_init (void)
 Configure SPI.
 
void spi_attach (void)
 Initialize SPI.
 
void spi_detach (void)
 Disable SPI and change to GPIO.
 
void SPI_send (unsigned char Register, unsigned char *Data, unsigned Length)
 SPI command if register data is larger than two bytes. More...
 
void SPI_send_byte (uint8_t Register, uint8_t Data)
 SPI command. More...
 
uint8_t SPI_read (unsigned char RDATA)
 SPI synchronous read.
 
void SPI_write (unsigned char Data)
 SPI synchronous write.
 
uint8_t SPI_write_ex (unsigned char Data)
 Send data to SPI with time out feature. More...
 
void sys_delay_ms (unsigned int ms)
 Delay mini-seconds. More...
 
void start_EPD_timer (void)
 Start Timer.
 
void stop_EPD_timer (void)
 Stop Timer.
 
uint32_t get_current_time_tick (void)
 Get current Timer after starting a new one.
 
void PWM_start_toggle (void)
 The PWM signal starts toggling.
 
void PWM_stop_toggle (void)
 The PWM signal stops toggling.
 
void PWM_run (uint16_t time)
 PWM toggling. More...
 
void initialize_temperature (void)
 Initialize the temperature sensor.
 
int16_t get_temperature (void)
 Get temperature value from ADC. More...
 
void EPD_display_hardware_init (void)
 Initialize the EPD hardware setting.
 

Detailed Description

The SPI, PWM, Temperature definitions of COG hardware driver.

Copyright (c) 2012-2013 Pervasive Displays Inc. All rights reserved.

Authors: Pervasive Displays Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

#define SPI_baudrate   (SMCLK_FREQ/COG_SPI_baudrate)

the baud rate of SPI

#define SPISEL   P1SEL

SPI Defines

Function Documentation

int16_t get_temperature ( void  )

Get temperature value from ADC.

Returns
the Celsius temperature
void PWM_run ( uint16_t  ms)

PWM toggling.

Parameters
msThe interval of PWM toggling (mini seconds)
void SPI_send ( unsigned char  register_index,
unsigned char *  register_data,
unsigned  length 
)

SPI command if register data is larger than two bytes.

Parameters
register_indexThe Register Index as SPI command to COG
register_dataThe Register Data for sending command data to COG
lengthThe number of bytes of Register Data which depends on which Register Index is selected.
void SPI_send_byte ( uint8_t  register_index,
uint8_t  register_data 
)

SPI command.

Parameters
register_indexThe Register Index as SPI command to COG
register_dataThe Register Data for sending command data to COG
uint8_t SPI_write_ex ( unsigned char  Data)

Send data to SPI with time out feature.

Parameters
dataThe data to be sent out
void sys_delay_ms ( unsigned int  ms)

Delay mini-seconds.

Parameters
msThe number of mini-seconds